Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create stale.yml #4440

Merged
merged 1 commit into from
Apr 17, 2024
Merged

Create stale.yml #4440

merged 1 commit into from
Apr 17, 2024

Conversation

letzya
Copy link
Collaborator

@letzya letzya commented Apr 17, 2024

User description

For internal users - Please add a Jira DX PR ticket to the subject!



Preview Link


Description


Screenshots (if appropriate)


Checklist

  • I have added a preview link to the PR description.
  • I have reviewed the guidelines for contributing to this repository.
  • I have read the technical guidelines for contributing to this repository.
  • Make sure you have started your change off our latest master.
  • I labelled the PR

Type

enhancement


Description

  • Introduced a GitHub Actions workflow to handle stale issues and PRs automatically.
  • The workflow is scheduled to run daily and will mark issues and PRs with no activity using specific labels.
  • Custom messages are set for stale notifications, and timeframes are defined for marking as stale and closing PRs.

Changes walkthrough

Relevant files
Configuration changes
stale.yml
Add GitHub Action for Stale Issues and PRs                             

.github/workflows/stale.yml

  • Adds a new GitHub Actions workflow to mark issues and PRs as stale.
  • Configures the schedule for the action to run daily.
  • Sets messages and labels for stale issues and PRs.
  • Defines the number of days before marking as stale and closing PRs.
  • +29/-0   

    PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    @letzya letzya merged commit 2899570 into letz-stale Apr 17, 2024
    6 checks passed
    @letzya letzya deleted the letz-stale-1 branch April 17, 2024 13:43
    Copy link
    Contributor

    PR Description updated to latest commit (518ba8e)

    Copy link
    Contributor

    PR Review

    ⏱️ Estimated effort to review [1-5]

    2, because the PR involves a straightforward addition of a GitHub Actions workflow for marking stale issues and PRs. The configuration is simple and follows standard practices for such workflows.

    🧪 Relevant tests

    No

    🔍 Possible issues

    Possible Bug: The cron schedule '14 29 * * *' seems incorrect. Cron syntax for minutes should be from 0 to 59. The current setting might not trigger the action as expected.

    🔒 Security concerns

    No

    Code feedback:
    relevant file.github/workflows/stale.yml
    suggestion      

    Correct the cron schedule syntax to ensure the action triggers correctly. For example, if you want it to run daily at 00:29, use '29 0 * * *'. [important]

    relevant line- cron: '14 29 * * *'

    relevant file.github/workflows/stale.yml
    suggestion      

    Consider increasing the 'days-before-stale' for issues to give more time for response. Setting it to 1 day might be too aggressive. Suggesting 30 days as a more reasonable default. [medium]

    relevant linedays-before-stale: 1

    relevant file.github/workflows/stale.yml
    suggestion      

    Add a step to check out the repository using 'actions/checkout@v2' before running the stale action. This ensures that all necessary repository data is available for the action. [medium]

    relevant line- uses: actions/stale@v5

    relevant file.github/workflows/stale.yml
    suggestion      

    Add an 'exempt-issue-labels' and 'exempt-pr-labels' option to prevent marking certain important issues or PRs as stale, such as those labeled 'priority'. [medium]

    relevant linestale-issue-label: 'no-issue-activity'


    ✨ Review tool usage guide:

    Overview:
    The review tool scans the PR code changes, and generates a PR review which includes several types of feedbacks, such as possible PR issues, security threats and relevant test in the PR. More feedbacks can be added by configuring the tool.

    The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.

    • When commenting, to edit configurations related to the review tool (pr_reviewer section), use the following template:
    /review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...
    
    [pr_reviewer]
    some_config1=...
    some_config2=...
    

    See the review usage page for a comprehensive guide on using this tool.

    Copy link
    Contributor

    PR Code Suggestions

    CategorySuggestions                                                                                                                                                       
    Enhancement
    Improve the clarity and informativeness of stale messages.

    Consider using a more descriptive and specific message for stale issues and pull requests.
    This helps contributors understand why their issue or PR was marked as stale and what they
    can do to reactivate it.

    .github/workflows/stale.yml [24-25]

    -stale-issue-message: 'Stale issue message'
    -stale-pr-message: 'Stale pull request message'
    +stale-issue-message: 'This issue has been inactive for a while. Add a comment or make an update to keep it open!'
    +stale-pr-message: 'This pull request has not been updated recently. Please update it soon, or it will be closed.'
     
    Extend the time before issues are marked as stale to be more accommodating.

    Increase the days-before-stale for issues to give contributors more time to respond. One
    day is quite aggressive and might not be enough for many contributors to react, especially
    those in different time zones or with less frequent GitHub activity.

    .github/workflows/stale.yml [28]

    -days-before-stale: 1
    +days-before-stale: 14  # Two weeks before marking as stale
     
    Add exemptions for certain labels to avoid marking important issues and PRs as stale.

    Add an exempt-issue-labels and exempt-pr-labels option to prevent marking certain
    important or critical issues and PRs as stale. This can help maintain focus on key areas
    without being disrupted by the stale bot.

    .github/workflows/stale.yml [26-27]

    -stale-issue-label: 'no-issue-activity'
    -stale-pr-label: 'no-pr-activity'
    +exempt-issue-labels: 'pinned, security'
    +exempt-pr-labels: 'pinned, security'
     
    Best practice
    Optimize the timing of the stale workflow execution.

    Adjust the cron schedule to a more typical time, such as early morning or late evening, to
    minimize disruption during active hours. The current setting might trigger during peak
    activity times for some contributors.

    .github/workflows/stale.yml [10]

    -- cron: '14 29 * * *'
    +- cron: '0 2 * * *'  # Runs at 2 AM UTC
     
    Define actions upon closing stale issues and PRs for better management and transparency.

    Specify an action to take when issues or PRs are closed due to inactivity, such as adding
    a label or commenting. This can provide a clear audit trail and help in managing
    post-closure activities.

    .github/workflows/stale.yml [29]

     days-before-pr-close: 7
    +close-issue-label: 'closed-inactive'
    +close-pr-comment: 'This PR has been closed due to inactivity. Please reopen it if you wish to continue working on it.'
     

    ✨ Improve tool usage guide:

    Overview:
    The improve tool scans the PR code changes, and automatically generates suggestions for improving the PR code. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on a PR.

    • When commenting, to edit configurations related to the improve tool (pr_code_suggestions section), use the following template:
    /improve --pr_code_suggestions.some_config1=... --pr_code_suggestions.some_config2=...
    
    [pr_code_suggestions]
    some_config1=...
    some_config2=...
    

    See the improve usage page for a comprehensive guide on using this tool.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    1 participant